/**
 * 连接两个字符串
 */

#include <stdio.h>

void concatenate(char s[], char t[]);

int main() {
    char s[100] = "hello, ";
    char t[] = "world!\n";
    concatenate(s, t);
    printf("%s", s);

    return 0;
}

void concatenate(char s[], char t[]) {
    int i, j;
    i = j = 0;
    for (i = 0; s[i] != '\0'; i++) ;
    while ((s[i++] = t[j++]) != '\0') ;
}
